//
//  RequestHandler.h
//  PigMarket
//
//  Created by Felix on 2019/4/11.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Request.h"
#import "Response.h"

NS_ASSUME_NONNULL_BEGIN

typedef void (^ResponseCallback)(Response *response);

@interface RequestHandler : NSObject

- (instancetype)initWithRequest: (Request *) request
               responseCallback: (ResponseCallback) callback;

/**
 发送请求
 */
- (void)sendRequest;

/**
 取消请求
 */
- (void)cancelRequest;

@end

NS_ASSUME_NONNULL_END
